FROM openjdk:8u342-jdk

ENV TZ="Asia/Shanghai"

RUN mkdir /app/
RUN mkdir /app/logs
RUN mkdir /app/target
RUN mkdir /app/conf

ADD target/* /app/target/
ADD conf/* /app/conf/

ENV JAVA_OPTIONS="-Xms512m -Xmx512m -Xmn256m -Xss1M -XX:MetaspaceSize=128M -XX:MaxMetaspaceSize=128M\
 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:PretenureSizeThreshold=20M -XX:CMSInitiatingOccupancyFraction=92\
 -XX:+CMSParallelInitialMarkEnabled -XX:+CMSScavengeBeforeRemark -XX:+DisableExplicitGC\
 -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/app/logs/java_heapdump.hprof\
 -Xloggc:/app/logs/gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M\
 -Dclient.properties.path=/app/conf/client.properties\
 -Dnatclient.home=/app\
 -Dlogback.configurationFile=/app/conf/logback.xml"

ENV JAVA_PARAMS=""


ENTRYPOINT java ${JAVA_OPTIONS} -jar /app/target/lightnat-client.jar ${JAVA_PARAMS}